home *** CD-ROM | disk | FTP | other *** search
- Path: ix.netcom.com!netnews
- From: jlilley@ix.netcom.com (John Lilley)
- Newsgroups: comp.lang.c++
- Subject: Re: Different "new" in g++ and TC++
- Date: 14 Mar 1996 17:56:00 GMT
- Organization: Netcom
- Message-ID: <4i9mjg$2m1@cloner3.netcom.com>
- References: <3148391A.4646@numerik.uni-kiel.de>
- NNTP-Posting-Host: den-co7-20.ix.netcom.com
- Mime-Version: 1.0
- Content-Type: Text/Plain; charset=US-ASCII
- X-NETCOM-Date: Thu Mar 14 9:56:00 AM PST 1996
- X-Newsreader: WinVN 0.99.7
-
- >A is a class with constructor A::A() and n is an
- >integer, apparently g++ and TC++ 3.0 do different jobs
- >on the expression "new A[n]": TC++ calls the constructor
- >apparently for every created object, while g++ does not.
-
- TC++ is correct. See ARM section 5.3.3, page 61:
-
- "Arrays of objects... if the class has a default constructor. (12.1)
- In that case, the default constructor will be called for each
- element of the array"
-
- john lilley
-
-